home *** CD-ROM | disk | FTP | other *** search
- //=--------------------------------------------------------------------------=
- // WebBitmapCtl.H
- //=--------------------------------------------------------------------------=
- // Copyright 1995 Microsoft Corporation. All Rights Reserved.
- //
- // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
- // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
- // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
- // PARTICULAR PURPOSE.
- //=--------------------------------------------------------------------------=
- //
- // class declaration for the WebBitmap control.
- //
- #ifndef _WEBBITMAPCONTROL_H_
-
- #include "IPServer.H"
- #include "CtrlObj.H"
- #include "Internet.h"
- #include "WebBitmapInterfaces.H"
- #include "Dispids.H"
-
-
- #include "DibClasses.H"
-
- typedef struct tagWEBBITMAPCTLSTATE {
-
- // TOOD: put state variables here, and probably get rid of fGarbage, unless
- // you have a real need for it
- //
- VARIANT_BOOL fGarbage;
-
- } WEBBITMAPCTLSTATE;
-
- //=--------------------------------------------------------------------------=
- // CWebBitmapControl
- //=--------------------------------------------------------------------------=
- // our control.
- //
- class CWebBitmapControl : public CInternetControl,
- public IWebBitmap,
- public ISupportErrorInfo {
-
- public:
- // IUnknown methods
- //
- DECLARE_STANDARD_UNKNOWN();
-
- // IDispatch methods
- //
- DECLARE_STANDARD_DISPATCH();
-
- // ISupportErrorInfo methods
- //
- DECLARE_STANDARD_SUPPORTERRORINFO();
-
- // IWebBitmap methods
- //
- // TODO: copy over the method declarations from WebBitmapInterfaces.H
- // don't forget to remove the PURE from them.
- //
- STDMETHOD(get_ReadyState)(THIS_ long FAR* thestate);
- STDMETHOD(get_Bitmap)(THIS_ OLE_DATAPATH FAR* path) ;
- STDMETHOD(put_Bitmap)(THIS_ OLE_DATAPATH path) ;
- STDMETHOD_(void, AboutBox)(THIS) ;
- STDMETHOD(Scramble)(THIS) ;
-
- // OLE Control stuff follows:
- //
- CWebBitmapControl(IUnknown *pUnkOuter);
- virtual ~CWebBitmapControl();
-
- // static creation function. all controls must have one of these!
- //
- static IUnknown *Create(IUnknown *);
-
- private:
- // overridables that the control must implement.
- //
- STDMETHOD(LoadBinaryState)(IStream *pStream);
- STDMETHOD(SaveBinaryState)(IStream *pStream);
- STDMETHOD(LoadTextState)(IPropertyBag *pPropertyBag, IErrorLog *pErrorLog);
- STDMETHOD(SaveTextState)(IPropertyBag *pPropertyBag, BOOL fWriteDefault);
- STDMETHOD(OnDraw)(HDC hdcDraw, LPCRECTL prcBounds, LPCRECTL prcWBounds, HDC hicTargetDev);
- virtual LRESULT WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
- virtual BOOL RegisterClassData(void);
-
- virtual HRESULT InternalQueryInterface(REFIID, void **);
- virtual void BeforeCreateWindow(void);
-
- virtual void AfterCreateWindow(void);
-
- // Internet specific callbacks:
- //
- /// OnData is called asynchronously as data for an object or property arrives...
- virtual HRESULT OnData( DISPID id, DWORD grfBSCF,IStream * bitstrm, DWORD amount );
-
- // OnProgess is called to allow you to present progess indication UI
- virtual HRESULT OnProgress( DISPID, ULONG progress, ULONG themax, ULONG, LPCWSTR);
-
-
- // private state information.
- //
-
- HRESULT SetBmpPath(const char *psz);
- HRESULT SetBmpPath(IStream *);
- HRESULT UpdateBitmap();
-
- enum bmpDownloadStates
- {
- bdsNoBitsYet,
- bdsGotFileHeader,
- bdsGotBitmapInfo,
- bdsGettingBits,
- bdsBitsAreDone
- };
-
-
- HDC m_dc;
- bmpDownloadStates m_state;
- DWORD m_oldSize;
- CDibFile * m_dibFile;
- CDibSection * m_dib;
-
- // Actual properties
- char * m_bmpPath;
-
- };
-
-
- // TODO: if you have an array of verbs, then add an extern here with the name
- // of it, so that you can include it in the DEFINE_CONTROLOBJECT.
- // ie. extern VERBINFO m_WebBitmapCustomVerbs [];
- //
- extern const GUID *rgWebBitmapPropPages [];
- DEFINE_CONTROLOBJECT(WebBitmap,
- &CLSID_WebBitmap,
- "WebBitmapCtl",
- CWebBitmapControl::Create,
- 1,
- &IID_IWebBitmap,
- "WebBitmap.HLP",
- &DIID_DWebBitmapEvents,
- OLEMISC_SETCLIENTSITEFIRST|OLEMISC_ACTIVATEWHENVISIBLE|OLEMISC_RECOMPOSEONRESIZE|OLEMISC_CANTLINKINSIDE|OLEMISC_INSIDEOUT,
- RESID_TOOLBOX_BITMAP,
- "WebBitmapWndClass",
- 1,
- rgWebBitmapPropPages,
- 0,
- NULL);
-
-
-
- #define _WEBBITMAPCONTROL_H_
- #endif // _WEBBITMAPCONTROL_H_
-
-
-